<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>综合数据分组</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <link rel="stylesheet" href="../../assets/css/micro/ident.css"/>
    <link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <script src="../../assets/libs/template-web.js"></script>
    <style>
        #ident-value-tmpl-box .layui-form-select{
            margin-right: 15px;
        }
        #ident-value-tmpl-box{
            float: left;
            margin-left: 15px;
        }
        .identValLabel{
            text-align: left;
            padding: 5px;
            width: 36px;
        }
    </style>
</head>
<body>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <!-- 左表 -->
        <div class=" layui-col-sm12 layui-col-md6 layui-col-lg6">
            <div class="layui-card">
                <div class="layui-card-header">分组</div>
                <div class="layui-card-body" >
                    <div id="ident-group-tmpl-box"></div>
                    <div id="page-box"></div>
                    <table class="layui-table" id="identGroupTable" lay-filter="identGroupTable" lay-skin="nob"></table>
                </div>
            </div>
        </div>
        <!-- 右树 -->
        <div class="layui-col-sm12 layui-col-md6 layui-col-lg6">
            <div class="layui-card">
                <div class="layui-card-header">分组值</div>
                <div class="layui-card-body mini-bar" >
                    <div class="layui-form toolbar" id="">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label identValLabel">版本</label>
                                <div class="layui-input-block identValBlock">
                                    <select name="versionSelect"  lay-filter="versionSelect" lay-verify="required" class="" id="version-tmpl-box">
                                    </select>
                                </div>
                                <div id="ident-value-tmpl-box"></div>
                            </div>
                        </div>
                    </div>


                    <ul id="treeTbTree" class="ztree" ></ul>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 添加分组弹窗 -->
<script type="text/html" id="model-add-Group">
    <form id="addGroupForm" lay-filter="addGroupForm" class="layui-form model-form ">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea"
                                  lay-verType="tips" ></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" checked=""  name="status" lay-skin="switch" lay-text="可用|不可用">
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="addGroupSubmit" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 修改分组弹窗 -->
<script type="text/html" id="model-edit-Group">
    <form id="editGroupForm" lay-filter="editGroupForm" class="layui-form model-form">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea"
                                  lay-verType="tips" ></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="可用|不可用">
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="editGroup" lay-submit >确定</button>
        </div>
    </form>
</script>

<!--渲染分组权限-->
<script type="text/tmpl" id="ident-group-tmpl">
    <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/macro/ident-group:queryList")}}
                <div class="layui-input-inline mr0">
                    <input name="name" class="layui-input layui-input-sm" type="text" placeholder="输入关键字"/>
                </div>
                {{/if}}
            </div>
            <div class="layui-inline">
                {{ if hasPower("/macro/ident-group:queryList")}}
                <button class="layui-btn icon-btn layui-btn-sm" lay-filter="formSubSearchTbLtrt" lay-submit>
                    <i class="layui-icon">&#xe615;</i>搜索
                </button>
                {{/if}}
                {{ if hasPower("/macro/ident-group:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-ident-group">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
            </div>
        </div>
    </div>
  </script>

<!-- 分组表格操作列DOM -->
<script id="ident-group-tableHandle-box">
</script>
<!-- 分组表格操作列 -->
<script type="text/tmpl" id="ident-group-tableHandle-tmp">
    {{ if hasPower("/macro/ident-group:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
    {{/if}}
    {{ if hasPower("/macro/ident-group:version")}}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="version">版本管理</a>
    {{/if}}
    {{ if hasPower("/macro/ident-group:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
    {{/if}}
</script>
<!--渲染分组值权限-->
<script type="text/tmpl" id="ident-value-tmpl">
    {{if hasPower("/macro/ident-value:add")}}
    <button class="layui-btn icon-btn layui-btn-sm" id="addIdentValueBtn">
        <i class="layui-icon">&#xe654;</i>新增
    </button>
    {{/if}}
    {{if hasPower("/macro/ident-value:edit")}}
    <button class="layui-btn icon-btn layui-btn-sm" id="editIdentValueBtn">
        <i class="layui-icon">&#xe642;</i>编辑
    </button>
    {{/if}}
    {{if hasPower("/macro/ident-value:delete")}}
    <button class="layui-btn icon-btn layui-btn-sm" id="deleteIdentValueBtn">
        <i class="layui-icon">&#xe640;</i>删除
    </button>
    {{/if}}
</script>

<!--渲染版本下拉-->
<script type="text/tmpl" id="version-tmpl">
    {{each versionList}}
    {{$value}}
    <option value="{{$value.id}}">{{$value.value}}</option>
    {{/each}}
</script>

<!-- 分组版本管理弹窗 -->
<script type="text/html" id="mode-version-Group">
    <form id="versionGroupForm" lay-filter="versionGroupForm" class="layui-form model-form">
        <div class="layui-form-item layui-row">
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">版本值</label>
                <div class="layui-input-block">
                    <input name="value" type="text" placeholder="请输入版本值" class="layui-input"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
                <label class="layui-form-label">版本备注</label>
                <div class="layui-input-block">
                    <input name="memo" type="text" placeholder="请输入版本备注" class="layui-input"
                           lay-verType="tips" />
                </div>
                <button class="layui-btn layui-btn-primary layui-btn-sm" lay-filter="addVersion" lay-submit >添加版本</button>
            </div>
        </div>
    </form>
    <div class="layui-form-item layui-row mode-version-table" >
        <table class="layui-table" id="identGroupVersionTable" lay-filter="identGroupVersionTable" lay-skin="nob"></table>
    </div>
</script>

<!-- 分组版本表格操作列DOM -->
<script id="ident-group-version-tableHandle-box">
</script>
<!-- 分组表格操作列 -->
<script type="text/tmpl" id="ident-group-versiontableHandle-tmp">
    {{ if hasPower("/macro/ident-group:version")}}
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete">删除</a>
    {{/if}}
</script>
<!-- js部分 -->
<script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>

<!-- Ztree树部分 -->
<script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="../../assets/libs/copy/clipboard.min.js"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/config/macroTable.js"></script>
<script src="../../assets/js/authority.js"></script>

<script type="text/javascript" src="../../assets/js/macro/ident.js"></script>
</body>

</html>